#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
#include <time.h>

void lc_rmdir(char *f)
{
	DIR *dir = opendir(f);
	struct dirent *a;
	struct stat buf;
	while (a = readdir(dir))
	{
//		if(strcmp(a->d_name,".") == 0 || strcmp(a->d_name,"..") == 0 )
//			continue;
//		{
			stat(a->d_name,&buf);
			if( S_ISREG(buf.st_mode) == 1 )
			{
				printf("there is a file\n");
			
			}			
//		}
	}
	closedir(dir);
//	rmdir(f);
	return ;
}

void main()
{
	lc_rmdir(".");
}